#include <queue>
#include <mutex>
#include <condition_variable>

#define MAX_CAPACITY 100
template <class T>
class blockqueue
{
public:
    std::queue<T> q;
    int max_capcity = MAX_CAPACITY; // 最大存储数量
    std::mutex pmut;                // 生产者锁
    std::mutex cmut;                // 消费者锁
    std::condition_variable pcon;
    std::condition_variable ccon;
    blockqueue()
    {
    }
    ~blockqueue()
    {
    }

    void push(T& task) {
        q.push(task);
    }

    void pop() {
        q.pop();
    }

    bool empty() {
        return q.empty();
    }

    size_t size() {
        return q.size();
    }

    T front() {
        return q.front();
    }
};
